package com.ytjj.qmyx.admin.service.imService.impl;

import com.ytjj.qmyx.admin.mapper.ImConfigInfoMapper;
import com.ytjj.qmyx.admin.model.ImConfigInfo;
import com.ytjj.qmyx.admin.model.vo.ImConfigInfoVO;
import com.ytjj.qmyx.admin.service.imService.ImConfigInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ImConfigInfoServiceImpl implements ImConfigInfoService {

    @Resource
    private ImConfigInfoMapper imConfigInfoMapper;

    /**
     *  修改设置开关
     * @param imConfigInfo
     * @return
     */
    @Override
    public int updateConfig(ImConfigInfoVO imConfigInfo) {
        Integer count = imConfigInfoMapper.updateById(imConfigInfo.getId(),imConfigInfo.getOffFlag(),imConfigInfo.getUpdateUser());
        return count;
    }

    /**
     *  查询全部设置
     * @return
     */
    @Override
    public List<ImConfigInfo> selectAll() {
        List<ImConfigInfo> list = imConfigInfoMapper.selectAll();
        return list;
    }
}
